home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
easydr2.zip
/
EASYDR2.DOC
< prev
next >
Wrap
Text File
|
1991-11-15
|
36KB
|
1,077 lines
1
Easy-Door Library
Version 2.0
for QuickBasic
Released on 01-November-1991
by Martin Bouchard
1207 du Golf
Cap-Rouge, Quebec
Canada
G1Y 2T4
Easy-Door is a library that provides a convenient and easy way
to program your own doors with Microsoft QuickBASIC.
Doors programmed with the Easy-Door library are compatibles
with:
QuickBBS, Remote Access, RBBS, SuperBBS, Telegard, WildCat
3, Force!, PcBoard (latest), GAP, WildCat BBS, Genesis,
Spitfire, WWIV, Osiris and others BBS softwares that uses
a compatible format with one mentioned above.
Features of the Easy-Door library:
----------------------------------
- ANSI/ASCII chat mode that freezes the users time
while in chat mode
- ANSI color graphic sequence support
- Automatic time left verification
- Automatic carrier detection
- Automatic updated status bar with user's
information
- Fast modem input/output
- Inactivity timeout verification
- Keys to force return to BBS or Hang up
- Menu with programmable hot keys
- Modem and keyboard controls
- Routines to change user's time
- Sysop DOS shell function
- Supports all COM ports
- Usefull file sender with pause, stop and more
- Uses fossil driver
- All text & messages are fully configurable
- And more...
Requirements
------------
- IBM Compatibles Computer (XT, 286, 386, 486...)
- QuickBasic 4.0 or 4.5
- An ANSI driver
- Easy-Door library V2.0
Easy-Door library v2.0 for QuickBasic 2
Copying and Distribution
------------------------
Easy-Door may be copied and distributed freely. If you
distribute Easy-Door on communication systems such as a BBS or
CompuServe, The Source, Genie, etc, you must include the
following files as a set (using ARC, ARJ, ZIP, LZH, PAK, etc.).
No fee other than a disk and handling charge (of up to 8$) may
be charged. The Easy-Door library is copyrighted and no
modification may be made to the library.
Description of files
---------------------
- EASYDR2.DOC (Easy-Door documentation)
- EASYDR2.LIB (Easy-Door module for compiling)
- EDRQLB.BAT (Batch file to create EASYDR2.QLB)
- REGISTER.DOC (Registration form)
- EASYDEMO.ZIP (Demo for getting started)
- T_HANOI.ZIP (A game using Easy-Door)
- EASYDOOR.BI (Easy-Door SUB/FUNCTION declaration)
- EASYANSI.BI (Include file for ANSI color code)
- EASYPARA.BI (Include file for configurable
parameters)
- AUTOBBS.BI (Module for semi-automatic BBS
detection)
- REGUSER.TXT (A note to registered users)
- PDQ.TXT (A note to PDQ users)
Easy-Door library v2.0 for QuickBasic 3
Disclaimer
----------
These routines have not caused me any problems, and seem to be
fully debuged. However, I will not be responsible for any
damages caused by use, misuse or inability to use Easy-Door.
Description of a door
---------------------
A door is an external program that works in conjunction with a
Bulletin Board System (BBS). Doors are difficult to program
because they have to use the modem input/output commands, ANSI
display, carrier detection, inactivity time out, time left, hot
keys, status bar, etc. This is where Easy-Door can be used. It
makes the usually tedious task of programming doors much
easier, and hence cuts the time of program development.
Fossil driver
-------------
A fossil driver is a resident program that controls different
things. X00 is such a driver (X00 is copyright by Ray Gwinn).
The advantage of a fossil driver is simple: you can count on
reliable communication routines, it supports various
configuration like COM3 and COM4 and it's very fast. There's
also other Revison 5 fossil driver likes BNU. A non-fossil
driver based version of Easy-Door is in developpement for those
who would prefers standard communication routines.
Easy-Door library v2.0 for QuickBasic 4
Registration
------------
The Easy-Door library is NOT public domain, it's SHAREWARE.
This means that you have to pay a registration fee of $25 US if
you decide to use the Easy-Door library in your programs. The
registration cost is minimal and will allow the author to write
new and improved versions of the Easy-Door library. Please note
that the unregistered version is the same as the registered
version except that a special credit screen is displayed each
time an Easy-Door program is executed. Registered users will
receive a disk containing the latest version of the Easy-Door
library with a unique encrypted serial number.
How to use Easy-Door library routines?
--------------------------------------
You must create the EasyDr2.QLB quick-library for the QB
environment. To do this, execute the batch file EDRQLB.BAT.
Example: EDRQLB EasyDr2 (This will create a .QLB for QB 4.5)
For others version of QuickBasic, edit the file EDRQLB.BAT and
change the indicated number (45) to your current version
number.
To use the Easy-Door library, you must first load Quick-Basic
with the (QB /l EasyDR2) statement. Each routine is used like
it was built in QuickBasic:
K$ = GetChar$
SendCR Red$ + "This red line is going to modem and screen"
Every Easy-Door variable is a string or integer. So, when using
numeric variables, put the % sign after the variable name or
put a DEFINT A-Z at the beginning of your program.
Easy-Door library v2.0 for QuickBasic 5
Technical information about Easy-Door
-------------------------------------
Easy-Door provides an easy alternative for writing your own
doors. For example, you don't have to pay attention about
opening the communication port. Easy-Door will automatically
determine which serial port is in use by the BBS.
To access the communication port, Easy-Door uses assembler
fossil driver routines. Consequently, you can access the
communication port at a high speed rate. To obtain ANSI
color/graphics, you must install in your CONFIG.SYS the
ANSI.SYS provided with DOS or a compatible driver (ZANSI,
NNANSI, etc.), if it's not already installed.
Each time an Easy-Door command is called, Easy-Door checks if
the user has disconnected. Also, Easy-Door checks the daily
time limit of the user and, after 2 minutes of inactivity or
any other value in the configuration, Easy-Door will hang up
the line and will return to the BBS.
A very useful option of Easy-Door is hot keys. Hot keys are
keys that the user can press during the transmission of a menu
so that a user will not have to wait for the end of the
transmission to press a key. Hot keys are difficult to program,
but with the Easy-Door library it's a pleasure to use.
User information is read in a file that each BBS program
produces every time a door is run. This file is different for
each type of BBS. Easy-Door supports a lots of them. But if you
don't run the door from a BBS, Easy-Door will put the door in
LOCAL mode.
Description of .BI file
-----------------------
Files that have the .BI extension (Basic Include) are modules
that you must include in your Easy-Door programs. Read those
files for more information on each one. To include a .BI file
in your program type (for example):
' $INCLUDE: 'EasyAnsi.BI'
Easy-Door library v2.0 for QuickBasic 6
Example of a door program structure
-----------------------------------
' DEFINT A-Z All variables are now integer by default
' Your own program DECLARE...
' INCLUDE$: 'EasyDoor.BI' SUB/FUNCTION Declaration
' INCLUDE$: 'AutoBBS.BI' Semi-automatic BBS type
detector.
' INCLUDE$: 'EasyANSI.BI' ANSI module
' INCLUDE$: 'EasyPara.BI' Parameters
' The INIT routine... Ex. Init Para$(), NPara()
' Your program code...
' The ReturnBBS routine...
Please see the EasyDemo.BAS file for a practical example of the
structure of an Easy-Door program.
Easy-Door library v2.0 for QuickBasic 7
String configurable parameters
------------------------------
Parameter Description
--------- -----------
Para$(1) = Chat mode entered
Para$(2) = ESC to end chat mode
Para$(3) = Hello this is the Sysop.
Para$(4) = Sysop chat text color
Para$(5) = User chat text color
Para$(6) = Sysop chat mode ended
Para$(7) = Warning - User inactivity timeout in 30
seconds
Para$(8) = User inactivity timeout, Hanging Up...
Para$(9) = ERROR: (Displayed when there's an error)
Para$(10) = Press S to stop or P to pause
Para$(11) = Press P to pause
Para$(12) = P (Pause key)
Para$(13) = S (Stop key)
Para$(14) = Hanging Up...
Para$(15) = No Carrier, Communication Lost
Para$(16) = Data file not found."
Para$(17) = Returning to BBS...
Para$(18) = Exceeded
Para$(19) = Time Limit Exceeded. Call Back Tomorrow
Para$(20) = More Y/N?
Para$(21) = Y (Yes key for more)
Para$(22) = N (No key for more)
Para$(23) = Displayed after a MORE Y/N ? (See file)
Para$(24) = Needs a revision 5 fossil driver to operate
Para$(25) = Paused (When PauseClock is activated)
Para$(26) = The Sysop has shelled to DOS...
Para$(27) = DOS Shell: Type <EXIT> to Return to DOOR
Para$(28) = The Sysop has returned from DOS
Para$(29) = Warning: Less than 2 min. remaining this
call
Para$(30) = FullName$ |
Para$(31) = Location$ |
Para$(32) = Baud$ | Information that were
Para$(33) = Com$ | read in DOORDEF.BI module
Para$(34) = AnsiFlag$ |
Para$(35) = TimeRemaining$ |
Para$(36) = Local Mode (Message when in local mode)
Para$(37) = min. (on status bar)
Easy-Door library v2.0 for QuickBasic 8
Numeric configurable parameters
-------------------------------
Parameter Description
--------- -----------
NPara(1) = 55 (Delay to lower DTR when hanging up in
18th/sec)
NPara(2) = 15 (Pause delay when 'P' hit sec.)
NPara(3) = 120 (User Inactivity Timeout in sec.)
NPara(4) = 18 (Delay after a no carrier in 18th/sec)
NPara(5) = 18 (Delay when DATA FILE NOT FOUND in
18th/sec)
NPara(6) = 24 (Nb of line in user's window)
NPara(7) = 1 (Carrier Detect On/Off)
NPara(8) = FG + 16 * BG Status Bar Color (combined
color number)
NPara(9) = 1 (Enable time counter)
NPara(10) = 0 (Used internally by time counter)
NPara(11) = 6 (Row where to put cursor when shelling
to DOS)
NPara(12) = 1 (Enable ALT-X or ALT-R to force exit)
NPara(13) = 120 (Enable warning before daily timeout,
0= off, or number of sec. for ON)
NPara(14) = 1 (Enable keys to change time)
NPara(15) = 0 (Used internally by inactivity
checker)
NPara(16) = 0 (Disable chat mode (0=Turn off, 1=Turn
on)
NPara(17) = 1 (Enable Status Bar)
NPara(18) = 42 (Column where BAUD/LOCALLY is displayed
on status bar)
Easy-Door library v2.0 for QuickBasic 9
EasyAnsi.BI Module
------------------
This include file contains all the necessary code to uses ANSI
escape sequence in your own door.
AnsiReset$: Resets all ANSI attributes
Blink$: Turns blinking on
Invert$: Turns on reverse color
Bright$: Turns on brighting
SavePos$: Saves current cursor position
RestorePos$: Restores the previously saved cursor
position
Foreground colors: Black$, Red$, Green$, Yellow$, Blue$,
Magenta$, Cyan$, White$
Background colors: BlackBack$, RedBack$, GreenBack$,
YellowBack$, BlueBack$, MagentaBack$,
CyanBack$, WhiteBack$
AutoBBS.BI Module
-----------------
AutoBBS.BI is a module that reads the command line, interprets
it and calls the door definition reader module corresponding to
the BBS program used. The command line must contains the name
of the door definition file used. For example, DORINFO1.DEF, if
passed on the command line, will activate the QBBS/RA/RBBS
module automatically. But if the command line is empty, the
door will executed in LOCAL mode.
Special keys that can be used with Easy-Door
--------------------------------------------
Alt H = Hangs Up
Alt R or X = Returns to the BBS without hanging up
Alt C = Enters Chat Mode
Alt J = Jumps to DOS (Dos Shell)
Alt = = Adds one minute to time remaining
Alt - = Substracts one minute to time
remaining
Easy-Door library v2.0 for QuickBasic 10
AddSlash$ (FilePath$)
---------------------
Type: Function
Adds a backslash to the filename if there's not one
already. Very usefull for processing configuration file.
Example: C:\QBBS ---> C:\QBBS\
C:\QBASIC\ ---> C:\QBASIC\
AnsiLocate Y%, X%
-----------------
Type: Subroutine
This routine is similar to the LOCATE statement. It puts
the cursor at specified rows and colums by using ANSI.
Note that the two parameters use Microsoft's convention
for cursor position (Y before X). AnsiLocate must be used
only if user has ANSI.
AnsiPrint Text$
---------------
Type: Subroutine
Prints a string on screen only and supports ANSI code if
an ANSI driver is present. It prints at the current
position and scrolls the screen, if necessary, to not
overwrite the status bar.
Example: AnsiPrint Green$ + "This line is not sent over
the modem."
Easy-Door library v2.0 for QuickBasic 11
BackSpace Number%
-----------------
Type: Subroutine
Sends a specified number of destructive backspace to modem
and screen.
Example: BackSpace(6) ' Sends 6 backspace
Bell State%
-----------
Type: Subroutine
Turns the SendBell routine on or off (ON=1, OFF=0). When
bell is turned off, no bell signal is sent.
Example: Bell 1 ' Turns on bell signal
Carrier State%
--------------
Type: Subroutine
Turns carrier detection on or off. (ON=1, OFF=0)
Example: Carrier 0 ' Carrier detection OFF
Cap$ (Text$)
-----------
Type: Function
Capitalizes a string. Gives a more professional look to
doors.
Example: User$= "JOHN-OLIVER SMITH"
User$= Cap$(User$)
' Results: John-Oliver Smith
Easy-Door library v2.0 for QuickBasic 12
Center$ (Text$)
--------------
Type: Function
Centers a string on a 80 column monitor.
Example: SendCR Center$("Returning to BBS.")
ChangeDTR State%
----------------
Type: Subroutine
Changes the Data Terminal Ready (DTR) status on the
current serial port. A value of 1 will raise the DTR, and
a 0 will lower it. On most modems, lowering the DTR will
force the modem to hang up.
Example: ChangeDTR 0 ' Puts the DTR low
ChangeDTR 1 ' Puts the DTR high
ChangeNPara Num%, Value%
------------------------
Type: Subroutine
Changes a numeric configuration parameters to a specified
value when the door is running.
Example: ChangeNPara 3, 60 ' Inactivity timeout = 60 sec.
ChangePara Num%, Message$
-------------------------
Type: Subroutine
Changes a string configuration parameters to a specified
parameter when the door is running.
Example: ChangePara 25, "Stopped" ' Pause clock message
Easy-Door library v2.0 for QuickBasic 13
ChangeTime NewTime%
-------------------
Type: Subroutine
Changes the time that the user has left (in minutes).
Example: ChangeTime 60 ' User has now 60 min. left
ChatMode
--------
Type: Subroutine
Forces the activation of the chat mode.
Example: ChatMode ' Chat mode is now activated
CheapSend Text$
---------------
Type: Subroutine
Sends a string without checking the carrier, the time
limit, or other special things. Used internally by Easy-
Door.
CheckCD
-------
Type: Subroutine
Forces Easy-Door to check if there is a lost of carrier on
the current serial port. If there is no carrier, the
program will be terminated and will return to DOS (or
return control to the BBS if installed on one). This
routine is not usually used because Easy-Door performs an
automatic carrier detection each time input/output is
made. But it can be used if no modem "i/o" is made for a
long period of time.
Example: CheckCD ' Forces Easy-Door to check for carrier
Easy-Door library v2.0 for QuickBasic 14
CheckIB State%
--------------
Type: Subroutine
Checks the input buffer. State% will be a non-zero value
if there's characters in the input buffer.
CheckInac
---------
Type: Subroutine
Loops until there's a character in the buffer and check
for inactivity timeout. Used internally
CheckOB State%
--------------
Type: Subroutine
Checks if the modem output buffer is full. State% will be
a
non-zero value if full.
Example: CheckOB State% ' 0= Empty, others= Full
ColorizeBAR
-----------
Type: Subroutine
Erases and colorize the status bar. Used internally.
Easy-Door library v2.0 for QuickBasic 15
Deinit
------
Type: Subroutine
Deinitializes the FOSSIL driver. Used internally by
Easy-Door. ReturnBBS automatically calls this routine, so
you have no reason to call it.
EndError (ErrorMessage$)
------------------------
Type: Subroutine
Terminate a door by printing a specified ERROR message.
Example: EndError "No configuration file was found"
GetChar$
-------
Type: Function
Returns either a one-character string containing a
character read from the modem/keyboard buffer or an empty
string ("") if no character is pending. This routine is
similar to the QuickBasic INKEY$ statement but reads a
character from modem and keyboard.
Example: K$ = GetChar$
HangUp
------
Type: Subroutine
Disconnects the user by hanging up the modem.
Example: HangUp ' Disconnects the user online
Easy-Door library v2.0 for QuickBasic 16
HotKeys State%
--------------
Type: Subroutine
Turns hot keys on or off. (ON=1, OFF=0)
Example: HotKeys 0 ' Turns off hot keys
Init Para$(), NPara%()
----------------------
Type: Subroutine
Initializes Easy-Door. Para$() and NPara%() are the two
arrays that contains your own preferences (see the file
EasyPara.BI). This routine is the most important of all.
It performs initialization to the modem, sets up different
parameters and more. You must call Init before any other
routine. If you omit this, your program will not work.
Example: Init Para$(), NPara%() ' Initialize Easy-Door
KeyExit State%
--------------
Type: Subroutine
Turns ALT-R or ALT-X on or off (ON=1, OFF=0).
Example: KeyExit 0 ' ALT-R/X is now off
LineFeed NumberOfLF%
--------------------
Type: Subroutine
Sends a specified number of linefeed to screen and modem.
Easy-Door library v2.0 for QuickBasic 17
ModemInput (Message$, Box$, Answer$, MaxLen%)
---------------------------------------------
Type: Subroutine
Inputs a string from the modem or the keyboard. You have
to specify the maximum length of the string. If MaxLen% is
a negative number, the answer will be in upper case. If
you don't want a prompt, use an empty string ("") for
Message$.
Example: ModemInput (Green$ + "Type your age: ",
BlueBack$ + White$, Age$, 2)
This line will ask the user for his age in
green. The answer will be in white on a two
characters blue box.
ModemInputChar$
--------------
Type: Function
Inputs a character from the modem or the keyboard. This
routine will wait for one character and returns control to
the program thereafter.
Example: K$ = ModemInputChar$
SendCR "You just pressed: " + k$
ModemOnlySend Text$
-------------------
Type: Subroutine
Sends a string of characters only to the modem, not to the
screen. No linefeed is added.
Easy-Door library v2.0 for QuickBasic 18
NoCarrier
---------
Type: Subroutine
Called internally by Easy-Door when there's no carrier.
NotFound
--------
Type: Subroutine
Displays a message warning the user that a file was not
found.
Num2Str$ (IntValue%)
-------------------
Type: Function
Converts an integer number to a string like BASIC STR$
function but does not add the spaces at the beginning and
ending of the string. Usefull for sending number with
SendCR.
Example: Number$ = Num2Str$ (1992)
' Number$ will be "1992"
PauseClock
----------
Type: Subroutine
Pauses the time left clock. Please note that the ordinary
time clock is not altered in any way.
Easy-Door library v2.0 for QuickBasic 19
PurgeInBuffer
-------------
Type: Subroutine
Clears all the pending characters in the modem and in the
keyboard input buffer.
Example: PurgeInBuffer
PurgeOutBuffer
--------------
Type: Subroutine
Clears all the characters in the output buffer not already
transmitted.
Example: PurgeOutBuffer
ResumeClock
-----------
Type: Subroutine
Restarts the time left clock paused by the PauseClock
routine.
ReturnBBS
---------
Type: Subroutine
You must use this routine to return to the BBS. DO NOT USE
the normal END statement otherwise the computer will
crash. This routine will also display a message on the
status bar to announce the return to the BBS.
Example: ReturnBBS ' Exits the DOOR and returns to the BBS
Easy-Door library v2.0 for QuickBasic 20
Send Text$
----------
Type: Subroutine
Sends a string of characters to the modem and to the
screen. No linefeed is added.
Example: Send "Welcome to this door!"
SendBell
--------
Type: Subroutine
Sends a BELL signal if the bell is turned on. The BELL is
hear only on the remote computer, not by the Sysop.
Example: SendBell ' Send a bell signal (ASCII 7)
SendCLS
-------
Type: Subroutine
Clears the screen on both side (local and remote).
Example: SendCLS ' The screen is now empty
SendCR Text$
------------
Type: Subroutine
Sends a string of characters to the modem and to the
screen. A linefeed is automatically added.
Example: SendCR "One moment please..."
Easy-Door library v2.0 for QuickBasic 21
SendFile FileName$, TypeNumber%
-------------------------------
Type: Subroutine
Displays a file. If the file exceeds the screen, it will
be scrolled. For a pause after each page use the SendTXT
routine instead.
TypeNumber% Function available
0 Pause and Stop
1 Pause only
Example: SendFile "EasyDoor.DOC", 0 ' Pause & Stop
enabled
SendMenu FileName$, KeyList$, Key$, TypeNumber%
-----------------------------------------------
Type: Subroutine
Sends a menu file. During the transmission, the user may
press a key in the KeyList$. The menu name must be a
filename with no extension. Easy-Door will add .ASC or
.ANS to the file name depending if the user has ASCII or
ANSI graphics.
TypeNumber% Description
0 Waits for a key if none is pressed during
transmission of the menu. A normal menu.
1 Do not wait for a key if none are pressed
during transmisson of the menu. Not often
used
Example: SendMenu "MainMenu", "DUQ", K$, 0 ' Transmits
the Menu.ASC or Menu.ANS file and waits for D,U
or Q
Easy-Door library v2.0 for QuickBasic 22
SendMenuString Text$, KeyList$, Key$, TypeNumber%
-------------------------------------------------
Type: Subroutine
Sends a string of characters and checks if a key was
pressed during the transmission. If there was no key
pressed when the string was sent, Easy-Door will wait for
one in the KeyList$ (except if TypeNumber% = 2)
TypeNumber% Description
0 Asks a key if no key was pressed during
transmission of the string.
1 Do not wait for a key when none are pressed
during transmisson of the string.
2 Do not uses the KeyList$, but enables stop
and pause (S/P). Usefull for users who
don't like to read everything. Advanced
user may use it.
Example: S$ = "[R]eturn to main menu, [Q]uit this DOOR"
SendString S$, "RQ", K$, 0
SendCR "The user has pressed: "+ K$
SendTXT FileName$, TypeNumber%
------------------------------
Type: Subroutine
Sends a normal text file and prompts for more at each end
of screen.
TypeNumber% Function available
0 Pause and Stop
1 Pause only
Example: SendTXT "EasyDoor.DOC", 0
Easy-Door library v2.0 for QuickBasic 23
SpecialCLS
----------
Type: Subroutine
Clears the screen locally and redraw the bottom status
bar.
StatusPrint Text$
-----------------
Type: Subroutine
Prints a strings on the status bar. The string is automa-
tically centered.
TimeKeys (State%)
-----------------
Type: Subroutine
Turns the keys to change time on or off (ON=1, OFF=0).
Those keys are (ALT -) and (ALT =).
TimeLeft%
--------
Type: Function
Returns the number of minutes left the user has.
Example: SendCR "You have " + Num2Str$(TimeLeft%) + "
min. remaining."
Easy-Door library v2.0 for QuickBasic 24
TimeOut (Minute%)
-----------------
Type: Subroutine
Changes the inactivity timeout delay (in minute).
Example: TimeOut 4 ' Sets the inactivity timeout to 4
minutes
WaitOB
------
Type: Subroutine
Loops until the modem output buffer become empty.
Easy-Door library v2.0 for QuickBasic 25
Note from the author:
Thank you for using the Easy-Door library. Hopefully, it
will be as useful to you as it is to me. Since Easy-Door
is so easy and powerfull, you might find yourself writing
your own door and putting it on the shareware market.
Regis-tration is, therefore, a good idea. Please register
today!
Special thanks:
Andre Morin, Nicolas Saillant, Ken Bienvenue, Mike Welch,
Wig DeMoville, Eric Yung, Gary Peterson, all registered
users and everybody who helped me in this project.
How to reach the author?
- by NetMail at Bab-O-Manie 1:240/507
- by International QuickBasic Echo
- by regular mail (see address at the beginning of
documentation)
* END *